<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改非实物登记')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-enterXuni-edit" th:object="${fEnterXuni}">
            <input name="xuniId" th:field="*{xuniId}" type="hidden">
            <input name="thingTypeId" type="hidden" id="thingTypeId" th:field="*{thingTypeId}"/>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">项目名称：</label>
                <div class="col-sm-8">
                    <input name="createName" th:field="*{createName}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">收支项目：</label>
                <div class="col-sm-8">
                    <div class="input-group">
                        <input readonly="readonly" required name="thingType" th:field="*{thingType}" onclick="selectThingTypeTree()" id="thingType" type="text" placeholder="请选择收支项目" class="form-control">
                        <span class="input-group-addon"><i class="fa fa-search"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支出时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="enterTime" th:value="${#dates.format(fEnterXuni.enterTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发票号：</label>
                <div class="col-sm-8">
                    <input name="lnvoiceNumber" th:field="*{lnvoiceNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发票总金额：</label>
                <div class="col-sm-8">
                    <input name="zonge" th:field="*{zonge}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">销售单位名称：</label>
                <div class="col-sm-8">
                    <input name="saleName" th:field="*{saleName}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "financial/enterXuni";
        $("#form-enterXuni-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-enterXuni-edit').serialize());
            }
        }

        $("input[name='enterTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function selectThingTypeTree() {
            var url = ctx + "financial/thingType/selectThingTypeTree/0/1111";
            var options = {
                title: '选择收支项目',
                width: "380",
                url: url,
                callBack: doSubmit2
            };
            $.modal.openOptions(options);
        }
        function doSubmit2(index, layero) {
            var body = $.modal.getChildFrame(index);
            $("#thingTypeId").val(body.find('#treeId').val());
            $("#thingType").val(body.find('#treeName').val());
            $.modal.close(index);
        }

    </script>
</body>
</html>